package praktikumid.w10.p4;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

public abstract class Shape extends MouseAdapter {
	public static final Color DEFAULT_COLOR = Color.BLACK;
	public static final Color HIGHLIGHT_COLOR = Color.RED;
	
	private Color color = DEFAULT_COLOR;
	protected boolean isFinished = false;
	
	protected boolean isHighlighted = false;
	
	public boolean isHighlighted() {
		return isHighlighted;
	}

	public void setHighlighted(boolean isHighlighted) {
		this.isHighlighted = isHighlighted;
	}

	public boolean isFinished() {
		return isFinished;
	}

	
	public Color getColor() {
		return color;
	}

	public void setColor(Color color) {
		this.color = color;
	}

	public abstract int getDistance(Point p);
	
	public void paintComponent(Graphics g) {
		if (isHighlighted) {
			g.setColor(HIGHLIGHT_COLOR);
		} else {
			g.setColor(color);
		}
	};
	
	public abstract void move(int dx, int dy);
	
	//public abstract void mouseClicked(MouseEvent e);
	//public abstract void mouseDragged(MouseEvent e);
	//public abstract void mouseReleased(MouseEvent e);
}
